﻿using CommunityToolkit.Mvvm.ComponentModel;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoneLine.Common;

namespace ZoneLine.Models
{
    /// <summary>
    /// 库存信息类
    /// </summary>
    [Table(Name = "Inventory")]
    public class InventoryInfoModel : ObservableObject
    {
        // <summary>
        /// ID
        /// </summary>
        [Column(IsIdentity = true)]
        public int Id { get; set; }

        private string _stationCode;
        /// <summary>
        /// 工站
        /// </summary>
        [DgColumnAttr("工站")]
        public string StationCode
        {
            get { return _stationCode; }
            set { SetProperty(ref _stationCode, value); }
        }

        private string _mainBatchCode;
        /// <summary>
        /// 主批次码
        /// </summary>
        [DgColumnAttr("主批次码")]
        public string MainBatchCode
        {
            get { return _mainBatchCode; }
            set { SetProperty(ref _mainBatchCode, value); }
        }
        

        private string _materialNo;
        /// <summary>
        /// 物料编号
        /// </summary>
        [DgColumnAttr("物料编号")]
        public string MaterialNo
        {
            get { return _materialNo; }
            set { SetProperty(ref _materialNo, value); }
        }

        private eMaterialType _materialType;
        /// <summary>
        /// 物料类型
        /// </summary>
        [DgColumnAttr("物料类型")]
        public eMaterialType MaterialType
        {
            get { return _materialType; }
            set { SetProperty(ref _materialType, value); }
        }

        private string _batchNo;
        /// <summary>
        /// 批次
        /// </summary>
        [DgColumnAttr("批次")]
        public string BatchNo
        {
            get { return _batchNo; }
            set { SetProperty(ref _batchNo, value); }
        }

        private int _qty;
        /// <summary>
        /// 库存量
        /// </summary>
        [DgColumnAttr("库存量")]
        public int Qty
        {
            get { return _qty; }
            set { SetProperty(ref _qty, value); }
        }

        private int _surplusQty;
        /// <summary>
        /// 余量
        /// </summary>
        [DgColumnAttr("余量")]
        public int SurplusQty
        {
            get { return _surplusQty; }
            set { SetProperty(ref _surplusQty, value); }
        }

        private int _singleDeductionQty;
        /// <summary>
        /// 单次扣除数量
        /// </summary>
        [DgColumnAttr("单次扣除数量")]
        public int SingleDeductionQty
        {
            get { return _singleDeductionQty; }
            set { SetProperty(ref _singleDeductionQty, value); }
        }

        private DateTime _creatTime;
        /// <summary>
        /// 创建时间
        /// </summary>
        [DgColumnAttr("创建时间")]
        public DateTime CreateTime
        {
            get { return _creatTime; }
            set { SetProperty(ref _creatTime, value); }
        }

    }



    public enum eMaterialType
    {
        /// <summary>
        /// 螺母
        /// </summary>
        [Display(Name = "Nut", Description = "螺母")]
        Nut = 1,
        /// <summary>
        /// 防尘盖
        /// </summary>
        [Display(Name = "DustCover", Description = "防尘盖")]
        DustCover = 2,
        /// <summary>
        /// 合件
        /// </summary>
        [Display(Name = "Component", Description = "合件")]
        Component = 3,
    }


}
